<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>智慧社区</title>
    <link href="../static/logo_css_js/css/default.css" th:href="@{/logo_css_js/css/default.css}" rel="stylesheet"/>
    <!--必要样式-->
    <link href="../static/logo_css_js/css/styles.css" th:href="@{logo_css_js/css/styles.css}" rel="stylesheet"/>
    <link href="../static/logo_css_js/css/demo.css" th:href="@{/logo_css_js/css/demo.css}" rel="stylesheet"/>
    <link href="../static/logo_css_js/css/loaders.css" th:href="@{/logo_css_js/css/loaders.css}" rel="stylesheet"/>


    <style>
        input:-webkit-autofill, textarea:-webkit-autofill, select:-webkit-autofill {
            -webkit-text-fill-color: #ededed !important;
            -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
            background-color: transparent;
            background-image: none;
            transition: background-color 50000s ease-in-out 0s;
        }

        input {
            background-color: transparent;
        }
        body {
            color: #333;
        }
    </style>

</head>
<body>
<div class='login'>
    <div class='login_title'>
        <span>欢迎登录 </span>
    </div>
    <div class='login_fields'>
        <form class="theme-signin" name="loginform" id="loginform" action="index" method="post">
            <div class='login_fields__user'>
                <div class='icon'>
                    <img alt="" src='../static/logo_css_js/img/user_icon_copy.png'
                         th:src="@{/logo_css_js/img/user_icon_copy.png}"/>
                </div>
                <input name="loginName" placeholder='用户名' maxlength="16" type='text' autocomplete="off" value="admin"/>
                <div class='validation'>
                    <img alt="" src='../static/logo_css_js/img/tick.png' th:src="@{/logo_css_js/img/tick.png}"/>
                </div>
            </div>
            <div class='login_fields__password'>
                <div class='icon'>
                    <img alt="" src='../static/logo_css_js/img/lock_icon_copy.png'
                         th:src="@{/logo_css_js/img/lock_icon_copy.png}"/>
                </div>
                <input name="loginPwd" placeholder='密码' maxlength="16" type='password' autocomplete="off"
                       value="123456">
                <div class='validation'>
                    <img alt="" src='../static/logo_css_js/img/tick.png' th:src="@{/logo_css_js/img/tick.png}"/>
                </div>
            </div>
            <div class='login_fields__password'>
                <div class='icon'>
                    <img alt="" src='../static/logo_css_js/img/key.png' th:src="@{/logo_css_js/img/key.png}"/>
                </div>
                <input style="width: 90px;" placeholder='验证码' maxlength="5" type='text' name="code" autocomplete="off">
                <a style="float: right; color: #fff;margin-top: 10px;" href="#" onclick="changeImg()">换一张</a>
                <img style="float: right; height: 44px;" id="imgObj" src="/article/validateCode" th:src="@{/validateCode}" onclick="changeImg()"/>

                <!--<div class='validation' style="opacity: 1; right: -5px;top: -3px;">-->
                <!--<canvas class="J_codeimg" id="myCanvas" onclick="Code();">对不起，您的浏览器不支持canvas，请下载最新版浏览器!</canvas>-->
                <!--</div>-->
            </div>
            <div class='login_fields__submit'>
                <input type='button' value='登录' onclick="login()">
            </div>
        </form>

    </div>
    <div class='success'>
    </div>
    <div class='disclaimer'>
        <div class="hellp_block clearfix">
            <div class="he_left">
                <img src="http://60.219.169.118:8099/appVersion/0.0.8.png" />

            </div>
            <div class="he_left">
                <a href="http://60.219.169.118:8099/appVersion/Handbook/CommunityHandBook.docx" >
                <img style="width: 69%;" src="../static/logo_css_js/img/hellp.png"
                     th:src="@{/logo_css_js/img/hellp.png}"/>
                </a>

            </div>

        </div>
        <p>
            <img style="width: 14px;" alt="" src='../static/logo_css_js/img/ltlogo.png'
                th:src="@{/logo_css_js/img/ltlogo.png}"/> 中国联通系统集成分公司
            <span class="span_button">支持与帮助</span>
        </p>

    </div>
</div>
<div class='authent'>
    <div class="loader" style="height: 44px;width: 44px;margin-left: 28px;">
        <div class="loader-inner ball-clip-rotate-multiple">
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
    <p>认证中...</p>
</div>
<div class="OverWindows"></div>
<link href="../static/logo_css_js/layui/css/layui.css" th:href="@{/logo_css_js/layui/css/layui.css}" rel="stylesheet"/>
<!--<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet" />-->
<!--<script src="../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>-->
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../static/logo_css_js/js/jquery-ui.min.js"
        th:src="@{/logo_css_js/js/jquery-ui.min.js}"></script>
<script type="text/javascript" src='../static/logo_css_js/js/stopExecutionOnTimeout.js?t=1'
        th:src="@{/logo_css_js/js/stopExecutionOnTimeout.js?t=1}"></script>
<script src="../static/logo_css_js/layui/layui.js" type="text/javascript"
        th:src="@{/logo_css_js/layui/layui.js}"></script>
<script src="../static/logo_css_js/js/Particleground.js" type="text/javascript"
        th:src="@{/logo_css_js/js/Particleground.js}"></script>
<script src="../static/logo_css_js/js/Treatment.js" type="text/javascript"
        th:src="@{/logo_css_js/Js/Treatment.js}"></script>
<script src="../static/logo_css_js/js/jquery.mockjax.js" type="text/javascript"
        th:src="@{/logo_css_js/js/jquery.mockjax.js}"></script>
<script type="text/javascript" src="../../static/js/prompt.js" th:src="@{/js/prompt.js}"></script>

<!--<script src="../static/js/jquery.min.js" type="text/javascript" th:src="@{/js/jquery.min.js}"></script>-->
<script type="text/javascript" th:inline="javascript">
    $(".span_button").click(function () {
        $(".hellp_block").slideToggle()
    });


    var codeError=[[${codeError}]];
    if(codeError!=null){
        $.MsgBox.Alert("提示", "验证码错误");
    }
    var error=[[${error}]];
    if(error!=null){
        $.MsgBox.Alert("提示", "用户名密码错误，请重新填写");
    }
    function login(){
        if($("input[name=code]").val()==""){
            $.MsgBox.Alert("提示", "请输入验证码");
            return false;
        }else{
            $("#loginform").submit();
        }
    }

    var canGetCookie = 0;//是否支持存储Cookie 0 不支持 1 支持
    var ajaxmockjax = 1;//是否启用虚拟Ajax的请求响 0 不启用  1 启用
    //默认账号密码
    var truelogin = "admin";
    var truepwd = "123456";

    // 刷新图片
    function changeImg() {
        var imgSrc = $("#imgObj");
        var src = imgSrc.attr("src");
        imgSrc.attr("src", changeUrl(src));
    }

    //为了使每次生成图片不一致，即不让浏览器读缓存，所以需要加上时间戳
    function changeUrl(url) {
        var timestamp = (new Date()).valueOf();
        var index = url.indexOf("?", url);
        if (index > 0) {
            url = url.substring(0, 13);
        }
        if ((url.indexOf("&") >= 0)) {
            url = url + "×tamp=" + timestamp;
        } else {
            url = url + "?timestamp=" + timestamp;
        }
        return url;
    }

//    var CodeVal = 0;
//    Code();

//    function Code() {
//        if (canGetCookie == 1) {
//            createCode("AdminCode");
//            var AdminCode = getCookieValue("AdminCode");
//            showCheck(AdminCode);
//        } else {
//            showCheck(createCode(""));
//        }
//    }
//
//    function showCheck(a) {
//        CodeVal = a;
//        var c = document.getElementById("myCanvas");
//        var ctx = c.getContext("2d");
//        ctx.clearRect(0, 0, 1000, 1000);
//        ctx.font = "60px 'Hiragino Sans GB'";
//        ctx.fillStyle = "#E8DFE8";
//        ctx.fillText(a, 0, 100);
//    }

    $(document).keypress(function (e) {
        // 回车键事件
        if (e.which == 13) {
            $('input[type="button"]').click();
        }
    });
    //粒子背景特效
    $('body').particleground({
        dotColor: 'rgba(0,0,0,.0)',
        lineColor: 'rgba(0,0,0,.0)'
    });
    $('input[name="pwd"]').focus(function () {
        $(this).attr('type', 'password');
    });
    $('input[type="text"]').focus(function () {
        $(this).prev().animate({'opacity': '1'}, 200);
    });
    $('input[type="text"],input[type="password"]').blur(function () {
        $(this).prev().animate({'opacity': '.5'}, 200);
    });
    $('input[name="login"],input[name="pwd"]').keyup(function () {
        var Len = $(this).val().length;
        if (!$(this).val() == '' && Len >= 5) {
            $(this).next().animate({
                'opacity': '1',
                'right': '30'
            }, 200);
        } else {
            $(this).next().animate({
                'opacity': '0',
                'right': '20'
            }, 200);
        }
    });
    var open = 0;
    var fullscreen = function () {
        elem = document.body;
        if (elem.webkitRequestFullScreen) {
            elem.webkitRequestFullScreen();
        } else if (elem.mozRequestFullScreen) {
            elem.mozRequestFullScreen();
        } else if (elem.requestFullScreen) {
            elem.requestFullscreen();
        } else {
            //浏览器不支持全屏API或已被禁用
        }
    }
    if (ajaxmockjax == 1) {
        $.mockjax({
            url: 'Ajax/Login',
            status: 200,
            responseTime: 50,
            responseText: {"Status": "ok", "Text": "登陆成功<br /><br />欢迎回来"}
        });
        $.mockjax({
            url: 'Ajax/LoginFalse',
            status: 200,
            responseTime: 50,
            responseText: {"Status": "Erro", "Erro": "账号名或密码或验证码有误"}
        });
    }
</script>
</body>
</html>